<?php


namespace Part18_MemoMode\Code3;

/**
 * 角色状态存储
 */
class RoleStateMemento
{
    // 生命力
    private $vitality;
    // 攻击力
    private $attack;
    // 防御力
    private $defense;

    public function __construct($vitality, $attack, $defense)
    {
        $this->vitality = $vitality;
        $this->attack = $attack;
        $this->defense = $defense;
    }

    public function getVitality()
    {
        return $this->vitality;
    }

    public function setVitality($vitality)
    {
        $this->vitality = $vitality;
    }

    public function getAttack()
    {
        return $this->attack;
    }

    public function setAttack($attack)
    {
        $this->attack = $attack;
    }

    public function getDefense()
    {
        return $this->defense;
    }

    public function setDefense($defense)
    {
        $this->defense = $defense;
    }
}